﻿using System.Collections.Generic;
using System.Data.Entity;

namespace Idea.DbContext
{
    public abstract class IdeaDbContext : System.Data.Entity.DbContext
    {
        protected IDictionary<string, DbSet> CollectionsBuffer;
        public IDictionary<string, DbSet> Collections
        {
            get 
            {
                if (CollectionsBuffer == null)
                {
                    CollectCollections();
                }
                return CollectionsBuffer;
            }
        }

        public IdeaDbContext(string name)
            : base(name)
        { }

        public abstract void CollectCollections();
    }
}
